﻿@{
    ViewBag.Title = "Assets";
}

<div class="page-content">
    <div class="page-header">
        <h1>
            资源管理
			<small>
                <i class="icon-double-angle-right"></i>
                assets resources
            </small>
        </h1>
    </div>
    <!-- /.page-header -->
    <div class="row">
        <div class="col-xs-4">
            <table class="table table-bordered table-fixed">
                <colgroup>
                    <col class="col-xs-5" />
                    <col />
                </colgroup>
                <caption>
                    <a href="#addGroup" data-bind="click: $root.addGroup" class="pull-right">添加</a>
                </caption>
                <thead>
                    <tr>
                        <th>组名</th>
                        <th>介绍</th>
                    </tr>
                </thead>
                <tbody data-bind="foreach: groups">
                    <tr data-bind="click: $root.onGroupClick,
                        event: { dblclick: event.edit },
                        attr: { 'data-id': groupId },
                        css: { 'active': $root.selectedgroup() == $data }">
                        <td>
                            <div class="nobr" data-bind="ifnot: _editing">
                                <span data-bind="text: groupName"></span>
                            </div>
                            <div class="input-group" data-bind="if: _editing">
                                <span class="input-group-addon" data-bind="click: $root.save"><i class="icon-save"></i></span>
                                <input type="text" class="form-control" data-bind="value: groupName" />
                            </div>
                        </td>
                        <td>
                            <div class="nobr" data-bind="ifnot: _editing">
                                <a  href="#" data-bind="attr: { href: site }, text: site" target="_blank"></a>
                            </div>
                            <div class="input-group" data-bind="if: _editing">
                                <input type="text" class="form-control" data-bind="value: site" />
                                <span class="input-group-addon" data-bind="click: $root.remove"><i class="icon-remove"></i></span>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="col-xs-5">
            <table class="table table-bordered table-fixed">
                <colgroup>
                    <col />
                    <col class="col-xs-3" />
                </colgroup>
                <caption>
                    <a data-bind="click: $root.addFile" class="pull-right">添加</a>
                </caption>
                <thead>
                    <tr>
                        <th>路径</th>
                        <th>版本</th>
                    </tr>
                </thead>
                <tbody data-bind="foreach: files">
                    <tr data-bind="click: $root.onFileClick,
                        event: { dblclick: event.edit },
                        attr: { 'data-id': fileId },
                        css: { 'active': $root.selectedfile() == $data }">
                        <td>
                            <div class="nobr" data-bind="ifnot: _editing">
                                <span data-bind="text: filePath"></span>
                            </div>
                            <div class="input-group" data-bind="if: _editing">
                                <span class="input-group-addon" data-bind="click: $root.save"><i class="icon-save"></i></span>
                                <input type="text" class="form-control" data-bind="value: filePath" />
                            </div>
                        </td>
                        <td>
                            <div class="nobr" data-bind="ifnot: _editing">
                                <span data-bind="text: version"></span>
                            </div>
                            <div class="input-group" data-bind="if: _editing">
                                <input type="text" class="form-control" data-bind="value: version" />
                                <span class="input-group-addon" data-bind="click: $root.remove"><i class="icon-remove"></i></span>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="col-xs-3">
            <table class="table table-bordered table-fixed">
                <colgroup>
                    <col />
                    <col class="col-xs-2" />
                </colgroup>
                <caption>
                    <a data-bind="click: $root.addCdn" class="pull-right">添加</a>
                </caption>
                <thead>
                    <tr>
                        <th>Cdn路径</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody data-bind="foreach: cdns">
                    <tr data-bind="click: $root.onCdnClick,
                        event: { dblclick: event.edit },
                        attr: { 'data-id': cdnId },
                        css: { 'active': $root.selectedcdn() == $data }">
                        <td>
                            <div class="nobr" data-bind="ifnot: _editing">
                                <span data-bind="text: sitePath"></span>
                            </div>
                            <div class="input-group" data-bind="if: _editing">
                                <span class="input-group-addon" data-bind="click: $root.save"><i class="icon-save"></i></span>
                                <input type="text" class="form-control" data-bind="value: sitePath" />
                                <span class="input-group-addon" data-bind="click: $root.remove"><i class="icon-remove"></i></span>
                            </div>
                        </td>
                        <td>
                            <div class="nobr" data-bind="ifnot: _editing">
                                <span data-bind="text: useable"></span>
                            </div>
                            <div class="" data-bind="if: _editing">
                                <input type="checkbox" data-bind="checked: useable, click: $root.Test" />
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
</div>
<!-- /.page-content -->

@section cssPagePlugin {
    @AssetsHelper.RenderLess(paths: "/assets/Bootstrap/table.less")
    @AssetsHelper.RenderLess(paths: "/assets/Bootstrap/text.less")
}
@section styles {
}
@section jsPagePlugin {
}
@section scripts {
    @AssetsHelper.RenderJS(paths: "/assets/js/manage-assets.js")
}